SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE VIEW dbo.vwLiquidaciones
AS
SELECT     L.idLiquidacion, L.Mes, L.Anio, L.Tipo AS IdTipo, TL.Descripcion AS Tipo, O.Nombre AS Organizacion, L.Organizacion AS IdOrganizacion, 
                      RL.Descripcion AS RegimenLaboral, L.RegimenLaboral AS IdRegimenLaboral, L.Desde, L.Hasta, L.LiquidacionCompleta, O.CUISE, 
                      L.IDCabeceraLiquidacion
FROM         dbo.tb_Liquidaciones L INNER JOIN
                      dbo.vwrOrganizaciones O ON L.Organizacion = O.ID INNER JOIN
                      dbo.vwrRegimenLaboral RL ON L.RegimenLaboral = RL.ID INNER JOIN
                      dbo.vwrTiposDeLiquidacion TL ON TL.ID = L.Tipo
GO
GRANT SELECT ON  [dbo].[vwLiquidaciones] TO [CentroDeDesignaciones]
GRANT SELECT ON  [dbo].[vwLiquidaciones] TO [Liquidaciones]
GRANT SELECT ON  [dbo].[vwLiquidaciones] TO [PersonalDocente]
GRANT SELECT ON  [dbo].[vwLiquidaciones] TO [SoloVer]
GRANT SELECT ON  [dbo].[vwLiquidaciones] TO [Subsidios]
GRANT SELECT ON  [dbo].[vwLiquidaciones] TO [SubsidiosConsulta]
GO
